package protocol.SZ_2021;

import java.util.HashMap;

public class Handle2021SZ01 implements IHandle2021SZ {
    @Override
    public String handle(SZ_2021Cmd cmd) {
        byte subOrder = cmd.subOrder();

        switch (subOrder){
            case 0x04:
                return handle0104(cmd);
            case 0x05:
                return handle0105(cmd);
            default:
                return "深标:未匹配的命令字"+(cmd.readOrder()+","+cmd.readSubOrder());
        }
    }

    private String handle0104(SZ_2021Cmd cmd) {
        StringBuilder builder = new StringBuilder();
        builder.append("终端->平台:查询终端参数应答");
        builder.append("\r\n");
        builder.append("应答流水号:"+cmd.readInt(2));
        builder.append("\r\n");
        builder.append("参数项列表:");
        builder.append("\r\n");

        handleA10(cmd,builder);
        return builder.toString();
    }


    private void handleA10(SZ_2021Cmd cmd, StringBuilder builder){
        do{
            int id = cmd.readInt(2);
            int len = cmd.readInt(1);
            builder.append("    "+Integer.toHexString(id)+"-");
            switch (id){
                case 0x0001:
                    builder.append("终端心跳发送间隔，秒:"+cmd.readInt(len));
                    break;
                case 0x0002:
                    builder.append("TCP消息应答超时时间，秒:"+cmd.readInt(len));
                    break;
                case 0x0003:
                    builder.append("TCP消息重传次数:"+cmd.readInt(len));
                    break;
                case 0x0004:
                    builder.append("SMS消息应答超时时间，秒:"+cmd.readInt(len));
                    break;
                case 0x0005:
                    builder.append("SMS消息重传次数:"+cmd.readInt(len));
                    break;
                case 0x0010:
                    builder.append("主服务器APN，无线通信拨号访问点:"+cmd.readString(len));
                    break;
                case 0x0011:
                    builder.append("主服务器无线通信拨号用户名:"+cmd.readString(len));
                    break;
                case 0x0012:
                    builder.append("主服务器无线通信拨号密码:"+cmd.readString(len));
                    break;
                case 0x0013:
                    builder.append("主服务器地址,IP或域名:"+cmd.readString(len));
                    break;
                case 0x0014:
                    builder.append("备份服务器APN，无线通信拨号访问点:"+cmd.readString(len));
                    break;
                case 0x0015:
                    builder.append("备份服务器无线通信拨号用户名:"+cmd.readString(len));
                    break;
                case 0x0016:
                    builder.append("备份服务器无线通信拨号密码:"+cmd.readString(len));
                    break;
                case 0x0017:
                    builder.append("备份服务器地址,IP或域名:"+cmd.readString(len));
                    break;
                case 0x0018:
                    builder.append("主服务器TCP端口:"+cmd.readInt(len));
                    break;
                case 0x0019:
                    builder.append("备份服务器TCP端口:"+cmd.readInt(len));
                    break;
                case 0x001A:
                    builder.append("一卡通主服务器地址,IP或域名（保留）:"+cmd.readString(len));
                    break;
                case 0x001B:
                    builder.append("一卡通主服务器TCP端口（保留）:"+cmd.readInt(len));
                    break;
                case 0x001C:
                    builder.append("一卡通备份服务器地址IP或域名（保留）:"+cmd.readString(len));
                    break;
                case 0x001D:
                    builder.append("一卡通备份服务器TCP端口（保留）:"+cmd.readInt(len));
                    break;
                case 0x0020:{
                    HashMap<Integer,String> list = new HashMap<>();
                    int type = cmd.readInt(len);
                    list.put(0,"定时汇报");
                    list.put(1,"定距汇报");
                    list.put(2,"定时 + 定距汇报");
                    builder.append("位置汇报策略:"+list.getOrDefault(type,"未定义"));
                    break;
                }
                case 0x0021:{
                    HashMap<Integer,String> list = new HashMap<>();
                    int type = cmd.readInt(len);
                    list.put(0,"根据ACC状态");
                    list.put(1,"根据空重车状态");
                    list.put(2,"根据登录状态 + ACC状态，先判断登录状态，若登录再根据ACC状态");
                    list.put(3,"根据登录状态 + 空重车状态，先判断登录状态，若登录再根据空重车状态");
                    builder.append("位置汇报方案:"+list.getOrDefault(type,"未定义"));
                    break;
                }
                case 0x0022:
                    builder.append("未登录汇报时间间隔，秒:"+cmd.readInt(len));
                    break;
                case 0x0023:
                    builder.append("ACC OFF汇报时间间隔，秒:"+cmd.readInt(len));
                    break;
                case 0x0024:
                    builder.append("ACC ON汇报时间间隔，秒:"+cmd.readInt(len));
                    break;
                case 0x0025:
                    builder.append("空车汇报时间间隔，秒:"+cmd.readInt(len));
                    break;
                case 0x0026:
                    builder.append("重车汇报时间间隔，秒:"+cmd.readInt(len));
                    break;
                case 0x0027:
                    builder.append("休眠时汇报时间间隔，秒:"+cmd.readInt(len));
                    break;
                case 0x0028:
                    builder.append("紧急报警时汇报时间间隔，秒:"+cmd.readInt(len));
                    break;
                case 0x0029:
                    builder.append("未登录汇报距离间隔，米:"+cmd.readInt(len));
                    break;
                case 0x002A:
                    builder.append("ACC OFF汇报距离间隔，米:"+cmd.readInt(len));
                    break;
                case 0x002B:
                    builder.append("ACC ON汇报距离间隔，米:"+cmd.readInt(len));
                    break;
                case 0x002C:
                    builder.append("空车汇报距离间隔，米:"+cmd.readInt(len));
                    break;
                case 0x002D:
                    builder.append("重车汇报距离间隔，米:"+cmd.readInt(len));
                    break;
                case 0x002E:
                    builder.append("休眠时汇报距离间隔，米:"+cmd.readInt(len));
                    break;
                case 0x002F:
                    builder.append("紧急报警时汇报距离间隔，米:"+cmd.readInt(len));
                    break;
                case 0x0030:
                    builder.append("拐点补传角度:"+cmd.readInt(len));
                    break;
                case 0x0031:
                    builder.append("司机登录在线认证主服务器IP地址或起名:"+cmd.readString(len));
                    break;
                case 0x0032:
                    builder.append("司机登录在线认证主服务器端口:"+cmd.readInt(len));
                    break;
                case 0x0033:
                    builder.append("司机登录在线认证备服务器IP地址或起名:"+cmd.readString(len));
                    break;
                case 0x0034:
                    builder.append("拐点补传角度:"+cmd.readInt(len));
                    break;
                case 0x0040:
                    builder.append("监控指挥中心电话号码:"+cmd.readString(len));
                    break;
                case 0x0041:
                    builder.append("复位电话号码:"+cmd.readString(len));
                    break;
                case 0x0042:
                    builder.append("恢复出厂设置电话号码:"+cmd.readInt(len));
                    break;
                case 0x0043:
                    builder.append("监控指挥中心SMS电话号码:"+cmd.readInt(len));
                    break;
                case 0x0044:
                    builder.append("接收终端SMS文本报警号码:"+cmd.readInt(len));
                    break;
                case 0x0045:{
                    HashMap<Integer,String> list = new HashMap<>();
                    int type = cmd.readInt(len);
                    list.put(0,"自动接听");
                    list.put(1,"ACC ON时自动接听，OFF时手动接听");
                    builder.append("终端电话接听策略:"+list.getOrDefault(type,"未定义"));
                    break;
                }
                case 0x0046:
                    builder.append("每次最长通话时间，秒:"+cmd.readInt(len));
                    break;
                case 0x0047:
                    builder.append("当月最长通话时间，秒:"+cmd.readInt(len));
                    break;
                case 0x0048:
                    builder.append("电话短号长度:"+cmd.readInt(len));
                    break;
                case 0x0049:
                    builder.append("监听电话号码:"+cmd.readString(len));
                    break;
                case 0x004A:
                    builder.append("终端设备维护密码:"+cmd.readString(len));
                    break;
                case 0x004B:
                    builder.append("终端的语音播报音量控制0-9 0静音 9为最高:"+cmd.readInt(len));
                    break;
                case 0x0050:
                    builder.append("报警屏蔽字，与位置信息汇报消息中的报警标志相对应，相应位为1则相应报警被屏蔽:"+cmd.readBCD(len));
                    break;
                case 0x0051:
                    builder.append("报警发送文本SMS开关，与位置信息汇报消息中的报警标志相对应，相应位为1则相应报警时发送文本SMS:"+cmd.readBCD(len));
                    break;
                case 0x0052:
                    builder.append("报警拍摄开关，与位置信息汇报消息中的报警标志相对应，相应位为1则相应报警时摄像头拍摄:"+cmd.readBCD(len));
                    break;
                case 0x0053:
                    builder.append("报警拍摄存储标志，与位置信息汇报消息中的报警标志相对应，相应位为1则对相应报警时拍的照片进行存储，否则实时上传:"+cmd.readBCD(len));
                    break;
                case 0x0055:
                    builder.append("最高速度，KM/H:"+cmd.readInt(len));
                    break;
                case 0x0056:
                    builder.append("超速持续时间，秒:"+cmd.readInt(len));
                    break;
                case 0x0057:
                    builder.append("连续驾驶时间门限，秒:"+cmd.readInt(len));
                    break;
                case 0x0058:
                    builder.append("最小休息时间，秒:"+cmd.readInt(len));
                    break;
                case 0x0059:
                    builder.append("最长停车时间，秒:"+cmd.readInt(len));
                    break;
                case 0x005A:
                    builder.append("当天累计驾驶时间门限，秒:"+cmd.readInt(len));
                    break;
                case 0x0070:
                    builder.append("图像/视频质量，1～10，1最好:"+cmd.readInt(len));
                    break;
                case 0x0071:
                    builder.append("亮度:"+cmd.readInt(len));
                    break;
                case 0x0072:
                    builder.append("对比度:"+cmd.readInt(len));
                    break;
                case 0x0073:
                    builder.append("饱和度:"+cmd.readInt(len));
                    break;
                case 0x0074:
                    builder.append("色度:"+cmd.readInt(len));
                    break;
                case 0x0075:{
                    int num = cmd.readInt(len);
                    builder.append("拍照照片存储策略：（相应位为0标识不存储，为1标识存储）:");
                    builder.append("\r\n");
                    builder.append("    ACC状态发生变化时拍照存储策略:"+(num&0x01));
                    builder.append("\r\n");
                    builder.append("    驾驶员签到签退拍照存储策略:"+(num>>1&0x01));
                    builder.append("\r\n");
                    builder.append("    计价器空转重时拍照存储策略:"+(num>>2&0x01));
                    builder.append("\r\n");
                    builder.append("    计价器重转空时（服务评价）拍照存储策略:"+(num>>3&0x01));
                    builder.append("\r\n");
                    builder.append("    定时拍照存储策略:"+(num>>4&0x01));
                    builder.append("\r\n");
                    builder.append("    开关门拍照存储策略:"+(num>>5&0x01));
                    builder.append("\r\n");
                    builder.append("    重车三分钟后拍照存储策略:"+(num>>6&0x01));
                    builder.append("\r\n");
                    builder.append("    不满意评价拍照:"+(num>>7&0x01));
                    builder.append("\r\n");
                    builder.append("    出城登记拍照:"+(num>>8&0x01));
                    builder.append("\r\n");
                    builder.append("    违规营运拍照:"+(num>>9&0x01));
                    builder.append("\r\n");
                    builder.append("    SD卡拔出拍照:"+(num>>10&0x01));
                    builder.append("\r\n");
                    builder.append("    GPS异常拍照:"+(num>>12&0x01));
                    builder.append("\r\n");
                    builder.append("    终端识别成功的司机照片:"+(num>>13&0x01));
                    break;
                }
                case 0x0076:{
                    int num = cmd.readInt(len);
                    builder.append("拍照照片上传策略：（相应位为0标识不上传，为1标识上传）:");
                    builder.append("\r\n");
                    builder.append("    ACC状态发生变化时拍照存储策略:"+(num&0x01));
                    builder.append("\r\n");
                    builder.append("    驾驶员签到签退拍照存储策略:"+(num>>1&0x01));
                    builder.append("\r\n");
                    builder.append("    计价器空转重时拍照存储策略:"+(num>>2&0x01));
                    builder.append("\r\n");
                    builder.append("    计价器重转空时（服务评价）拍照存储策略:"+(num>>3&0x01));
                    builder.append("\r\n");
                    builder.append("    定时拍照存储策略:"+(num>>4&0x01));
                    builder.append("\r\n");
                    builder.append("    开关门拍照存储策略:"+(num>>5&0x01));
                    builder.append("\r\n");
                    builder.append("    重车三分钟后拍照存储策略:"+(num>>6&0x01));
                    builder.append("\r\n");
                    builder.append("    不满意评价拍照:"+(num>>7&0x01));
                    builder.append("\r\n");
                    builder.append("    出城登记拍照:"+(num>>8&0x01));
                    builder.append("\r\n");
                    builder.append("    违规营运拍照:"+(num>>9&0x01));
                    builder.append("\r\n");
                    builder.append("    SD卡拔出拍照:"+(num>>10&0x01));
                    builder.append("\r\n");
                    builder.append("    GPS异常拍照:"+(num>>12&0x01));
                    builder.append("\r\n");
                    builder.append("    终端识别成功的司机照片:"+(num>>13&0x01));
                    break;
                }
                case 0x0077:{
                    HashMap<Integer,String> list = new HashMap<>();
                    int type = cmd.readInt(len);
                    list.put(0,"不启用");
                    list.put(1,"全程");
                    list.put(2,"重车状态下");
                    builder.append("定时拍照方式:"+list.getOrDefault(type,"未定义"));
                    break;
                }
                case 0x0078:
                    builder.append("定时拍照时间间隔，单位s:"+cmd.readInt(len));
                    break;
                case 0x0079:{
                    HashMap<Integer,String> list = new HashMap<>();
                    int type = cmd.readInt(len);
                    list.put(0,"320*240");
                    list.put(1,"640*480");
                    list.put(2,"800*600");
                    builder.append("定时拍照分辨率:"+list.getOrDefault(type,"未定义"));
                    break;
                }
                case 0x007A:
                    builder.append("报警时拍照的照片数量（内外均拍）:"+cmd.readInt(len));
                    break;
                case 0x007B:
                    builder.append("报警时拍照时间间隔，单位s:"+cmd.readInt(len));
                    break;
                case 0x0080:
                    builder.append("车辆里程表读数，1/10KM:"+cmd.readInt(len));
                    break;
                case 0x0081:
                    builder.append("车辆所在的省域ID，1～255（省级行政区划代码前2位；终端根据此ID生成所在省的简称即对应车牌号第一个汉字）:"+cmd.readInt(len));
                    break;
                case 0x0082:
                    builder.append("车辆所在的市域ID，1～255（行政区划代码的第3、4位）:"+cmd.readInt(len));
                    break;
                case 0x0090:
                    builder.append("计程计价装置营运次数限制，0-9999；0表示不做限制:"+cmd.readBCD(len));
                    break;
                case 0x0091:
                    builder.append("计程计价装置营运时间限制，YYYY-MM-DD-hh，0000000000表示不做限制:"+cmd.readBCD(len));
                    break;
                case 0x0092:
                    builder.append("企业编码:"+cmd.readString(len));
                    break;
                case 0x0093:
                    builder.append("企业简称:"+cmd.readString(len));
                    break;
                case 0x0094:
                    builder.append("车牌号码:"+cmd.readString(len));
                    break;
                case 0x0095:
                    builder.append("发动机编号:"+cmd.readString(len));
                    break;
                case 0x0096:
                    builder.append("车架号:"+cmd.readString(len));
                    break;
                case 0x0097:
                    builder.append("车辆颜色:"+cmd.readString(len));
                    break;
                case 0x00A0:
                    builder.append("智能终端录音模式（0X01：全程录音；0X02：翻牌录音）:"+cmd.readInt(len));
                    break;
                case 0x00A1:
                    builder.append("智能终端录音文件最大时长（1-255）分钟:"+cmd.readInt(len));
                    break;
                case 0x00A2:
                    builder.append("液晶（终端）心跳时间间隔(单位S 1-60):"+cmd.readInt(len));
                    break;
                case 0x00A3:
                    builder.append("LED心跳时间间隔(单位S 1-60):"+cmd.readInt(len));
                    break;
                case 0x00AF:
                    builder.append("ACC OFF后进入休眠模式的时间，单位S:"+cmd.readInt(len));
                    break;
                case 0x00B0:
                    builder.append("视频服务器协议模式 0X00：TCP；0X01：UDP（保留）:"+cmd.readInt(len));
                    break;
                case 0x00B1:
                    builder.append("视频服务器APN，无线通信拨号访问点（保留）:"+cmd.readString(len));
                    break;
                case 0x00B2:
                    builder.append("视频服务器无线通信拨号用户名（保留）:"+cmd.readString(len));
                    break;
                case 0x00B3:
                    builder.append("视频服务器无线通信拨号密码（保留）:"+cmd.readString(len));
                    break;
                case 0x00B4:
                    builder.append("视频服务器地址,IP或域名（保留）:"+cmd.readInt(len));
                    break;
                case 0x00B5:
                    builder.append("视频服务器端口（保留）:"+cmd.readString(len));
                    break;
                case 0x00B6:
                    builder.append("人脸识别主服务器地址,IP或域名:"+cmd.readString(len));
                    break;
                case 0x00B7:
                    builder.append("人脸识别主服务器TCP端口:"+cmd.readInt(len));
                    break;
                case 0x00B8:
                    builder.append("人脸识别备份服务器地址IP或域名:"+cmd.readString(len));
                    break;
                case 0x00B9:
                    builder.append("人脸识别备份服务器TCP端口:"+cmd.readInt(len));
                    break;
                case 0x00BA:
                    builder.append("终端生成离线服务评价二维码中访问后台的网址（第一个参数问号前面部分）:"+cmd.readString(len));
                    break;
                case 0x00BB:
                    builder.append("终端生成离线支付评价二维码中访问后台的网址:"+cmd.readString(len));
                    break;
                case 0x0100:
                    builder.append("空转重后语音提示的附加信息，最多100字节。\n" +
                            "默认内容为：“请对我们的服务进行监督”。\n" +
                            "该参数用于定义在播放完“欢迎乘坐XXX出租汽车”后播放的内容:"+cmd.readString(len));
                    break;
                case 0x0200:
                    builder.append("超速报警提醒次数（0-不提醒；0xFFFF）:"+cmd.readInt(len));
                    break;
                case 0x0201:
                    builder.append("超速报警提醒间隔：单位：秒:"+cmd.readInt(len));
                    break;
                case 0x0202:
                    builder.append("连续疲劳驾驶报警提醒次数（0-不提醒；0xFFFF）:"+cmd.readInt(len));
                    break;
                case 0x0203:
                    builder.append("连续疲劳驾驶提醒间隔：单位：秒:"+cmd.readInt(len));
                    break;
                case 0x0204:
                    builder.append("累计疲劳驾驶报警提醒次数（0-不提醒；0xFFFF）:"+cmd.readInt(len));
                    break;
                case 0x0205:
                    builder.append("累计疲劳驾驶提醒间隔：单位：秒:"+cmd.readInt(len));
                    break;
                case 0x0230:
                    builder.append("电召中心电话号码（该号码不做呼入呼出限制）:"+cmd.readString(len));
                    break;
                case 0x44A0:
                    builder.append("附加费（为0 标识不启用），单位分:"+cmd.readInt(len));
                    break;
                case 0x44A1:
                    builder.append("附加费生效日期，格式为YYYYMMDD（全0标识不启用）:"+cmd.readBCD(len));
                    break;
                case 0x44A2:
                    builder.append("电召服务费（为0 标识不启用），单位分:"+cmd.readInt(len));
                    break;
                case 0x44A3:
                    builder.append("电召服务生效日期，格式为YYYYMMDD（全0标识不启用）:"+cmd.readBCD(len));
                    break;
                case 0x44C0:
                    builder.append("视频预录时间（单位：S, 0-60,0表示不预录）:"+cmd.readInt(len));
                    break;
                case 0x44C1: {
                    HashMap<Integer,String> list = new HashMap<>();
                    int type = cmd.readInt(len);
                    list.put(0,"不启用录像存储");
                    list.put(1,"全程录像");
                    list.put(2,"翻牌录像");
                    builder.append("对外摄像头录像模式:"+list.getOrDefault(type,"未定义"));
                    break;
                }
                case 0x44C2:{
                    HashMap<Integer,String> list = new HashMap<>();
                    int type = cmd.readInt(len);
                    list.put(0,"不启用录像存储");
                    list.put(1,"全程录像");
                    list.put(2,"翻牌录像");
                    builder.append("对内摄像头录像模式:"+list.getOrDefault(type,"未定义"));
                    break;
                }
                case 0x44C3:{
                    HashMap<Integer,String> list = new HashMap<>();
                    int type = cmd.readInt(len);
                    list.put(1,"视频流");
                    list.put(2,"音视频复合流");
                    builder.append("对外摄像头存储数据类型:"+list.getOrDefault(type,"未定义"));
                    break;
                }
                case 0x44C4:{
                    HashMap<Integer,String> list = new HashMap<>();
                    int type = cmd.readInt(len);
                    list.put(1,"CIF");
                    list.put(2,"HD1");
                    list.put(3,"D1");
                    list.put(4,"720p");
                    list.put(5,"1080p");

                    builder.append("对外摄像头存储视频分辨率:"+list.getOrDefault(type,"未定义"));
                    break;
                }
                case 0x44C5:{
                    builder.append("对外摄像头存储帧率；范围：1~25:"+cmd.readInt(len));
                    break;
                }
                case 0x44C6:{
                    HashMap<Integer,String> list = new HashMap<>();
                    int type = cmd.readInt(len);
                    list.put(1,"CBR");
                    list.put(2,"VBR");
                    builder.append("对外摄像头存储码流类型:"+list.getOrDefault(type,"未定义"));
                    break;
                }
                case 0x44C7:{
                    builder.append("对外摄像头存储码流质量；当码流类型为VBR时，这个字段才有效。取值范围：0~5，数值越大，图像效果越差:"+cmd.readInt(len));
                    break;
                }
                case 0x44C8:{
                    builder.append("对外摄像头存储码率上限；取值：32~1536，单位为KB/s:"+cmd.readInt(len));
                    break;
                }
                case 0x44C9:{
                    HashMap<Integer,String> list = new HashMap<>();
                    int type = cmd.readInt(len);
                    list.put(1,"视频流");
                    list.put(2,"音视频复合流");
                    builder.append("对内摄像头存储数据类型:"+list.getOrDefault(type,"未定义"));
                    break;
                }
                case 0x44CA:{
                    HashMap<Integer,String> list = new HashMap<>();
                    int type = cmd.readInt(len);
                    list.put(1,"CIF");
                    list.put(2,"HD1");
                    list.put(3,"D1");
                    list.put(4,"720p");
                    list.put(5,"1080p");

                    builder.append("对内摄像头存储视频分辨率:"+list.getOrDefault(type,"未定义"));
                    break;
                }
                case 0x44CB:{
                    builder.append("对内摄像头存储帧率；范围：1~25:"+cmd.readInt(len));
                    break;
                }
                case 0x44CC:{
                    HashMap<Integer,String> list = new HashMap<>();
                    int type = cmd.readInt(len);
                    list.put(1,"CBR");
                    list.put(2,"VBR");
                    builder.append("对内摄像头存储码流类型:"+list.getOrDefault(type,"未定义"));
                    break;
                }
                case 0x44CD:{
                    builder.append("对内摄像头存储码流质量；当码流类型为VBR时，这个字段才有效。取值范围：0~5，数值越大，图像效果越差:"+cmd.readInt(len));
                    break;
                }
                case 0x44CE:{
                    builder.append("对内摄像头存储码率上限；取值：32~1536，单位为KB/s:"+cmd.readInt(len));
                    break;
                }
                case 0x44CF:{
                    builder.append("本地视频播放授权密码:"+cmd.readString(len));
                    break;
                }
                case 0x44D0:{
                    builder.append("文件上传状态通知上报间隔，单位：s，值为0时表示不上报状态:"+cmd.readInt(len));
                    break;
                }
                case 0x0F34:{
                    builder.append("Wifi使能开关:"+cmd.readInt(len));
                    break;
                }
                case 0x0F35:{
                    builder.append("Wifi名:"+cmd.readString(len));
                    break;
                }
                case 0x0F36:{
                    builder.append("Wifi密码:"+cmd.readString(len));
                    break;
                }
                case 0x0F9B:{
                    builder.append("急加速报警阈值：");
                    builder.append("\r\n");
                    builder.append("    油门深度1-100，表示1%~100%，默认：80:"+(cmd.readInt(1)));
                    builder.append("\r\n");
                    builder.append("    持续时间，单位：s，默认：3:"+(cmd.readInt(1)));
                    builder.append("\r\n");
                    builder.append("    加速度，单位:m/s2，默认：2:"+(cmd.readInt(1)));
                    builder.append("\r\n");
                    builder.append("    速度阈值，默认：30km/h:"+(cmd.readInt(1)));
                    builder.append("\r\n");
                    break;
                }
                case 0x0F9C:{
                    builder.append("急减速报警阈值：");
                    builder.append("\r\n");
                    builder.append("    刹车深度1-100，表示1%~100%，默认：80:"+(cmd.readInt(1)));
                    builder.append("\r\n");
                    builder.append("    持续时间，单位：s，默认：3:"+(cmd.readInt(1)));
                    builder.append("\r\n");
                    builder.append("    加速度，单位:m/s2，默认：2:"+(cmd.readInt(1)));
                    builder.append("\r\n");
                    builder.append("    速度阈值，默认：30km/h:"+(cmd.readInt(1)));
                    builder.append("\r\n");
                    break;
                }
                default:
                    builder.append("未识别该命令，内容为:"+cmd.readBCD(len));
            }

            builder.append("\r\n");
        }while (cmd.leftSize() > 3);
    }



    private String handle0105(SZ_2021Cmd cmd) {
        StringBuilder builder = new StringBuilder();
        builder.append("终端->平台:智能终端升级结果报告消息");
        builder.append("\r\n");
        builder.append("设备类型:"+cmd.readInt(1));
        builder.append("\r\n");
        builder.append("厂商标识:"+cmd.readInt(1));
        builder.append("\r\n");
        builder.append("硬件版本号:"+cmd.readBCD(1));
        builder.append("\r\n");
        builder.append("软件版本号:"+cmd.readBCD(2));
        builder.append("\r\n");

        int type = cmd.readInt(1);
        HashMap<Integer,String> list = new HashMap<>();
        list.put(0x00,"软件版本号一致，无需升级");
        list.put(0x01,"升级成功");
        list.put(0x02,"升级失败");
        list.put(0x03,"厂商标识不一致");
        list.put(0x04,"硬件版本号不一致");
        list.put(0x05,"下载升级文件失败");
        list.put(0x06,"升级服务器主动取消升级");
        list.put(0x07,"设备主动放弃升级（非自身程序）");
        list.put(0x08,"中心查询软、硬件版本");

        builder.append("升级结果("+type+"):"+list.getOrDefault(type,"未定义"));
        builder.append("\r\n");

        return builder.toString();
    }

}
